package com.xing.binbackend.pattern.adapter24.operation;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 这个真的是适配器模式吗 怎么这么像策略模式？？？传入String 然后给出对应实例
 */
@Service
public class Client {
    @Resource
    private MonitorAdapterFactory factory;

    public void checkCloudStatus(String vendor) {
        CloudMonitor adapter = factory.getAdapter(vendor);
        MetricData metrics = adapter.getCpuUsage("i-12345678");
        // 告警处理逻辑...
    }
}
